<div id="column-2" class="column" style="width: 75%">
		
	<div class="sidebar">
		<%= link_to_bar @bar.id, 'big' %>
		
		<ul>
			<li>
				<%= link_to "Bild hinzuf&uuml;gen", {:controller => :bar_images,
														  :action => :add,
														  :id => @bar.id} %>
			</li>
			<li>
				<%= link_to "Feed abonnieren", :controller => :bars,
											   :action => :feed,
											   :id => @bar.id %>
			</li>
		</ul>
		
		<h4>Aktionen</h4>
		<ul>
			<li>
				<%= link_to "Das ist eine meiner Stammbars!", 
							{:controller => :user_bars,
							 :action => :add,
							 :id => @bar.id},
							{:method => :post,
							 :confirm => "Bist du dir sicher?"} %>
			</li>
			<li>
				<%= link_to "Ich gehe heute hin!", {:controller => :bars,
												    :action => :add_visitor,
												    :id => @bar.id},
												   {:method => :post,
													:confirm => "Bist du dir sicher?"} %>
			</li>
			<li>
				<%= link_to "Ansto&szlig;en!", {:controller => :bars,
											   :action => :do_action,
											   :id => @bar.id,
											   :a => 1},
											   {:method => :post,
												:confirm => "Bist du dir sicher?"} %>
			</li>
			<li>
				<%= link_to "Runde ausgeben!", {:controller => :bars,
											   :action => :do_action,
											   :id => @bar.id,
											   :a => 2},
											   {:method => :post,
												:confirm => "Bist du dir sicher?"} %>
			</li>
			<li>
				<%= link_to "Weiterempfehlen",  :controller => :bars,
											    :action => :recommend,
											    :id => @bar.id %>
			</li>
			<li class="spacer"></li>
			<li>
				<%= link_to "Ich bin der Besitzer!",  :controller => :bars,
											    	  :action => :add_owner,
											    	  :id => @bar.id %>
			</li>
			<li>
				<%= link_to "Ich bin ein Mitarbeiter!",  :controller => :bars,
											    	  	 :action => :add_coworker,
											    	  	 :id => @bar.id %>
			</li>
		</ul>
	</div>
	
	<div class="content">
		<h3>
		    <strong> <%= h(@bar.name) %></strong><br />
			<span><%= h(@bar.city) %>, <%= h(@bar.street) %></span>
		</h3>
		
		<h4><%= h(@bar.name) %> Informationen</h4>
		<table>
			
			<tr>
				<td class="left-column">Stammg&auml;ste</td>
				<td class="right-column">
					<%= h(@bar.bar_guests_count) %> 
					<%= link_to_function  "(Ansehen)", 
									      "Effect.Fade('online_bar_guests'); " + 
										  "Effect.toggle('bar_guests');"   if @bar.bar_guests_count.to_i > 0 %>
					/ <strong>Online:</strong>
					<%= h(count_online_guests()) %> 
					<%= link_to_function  "(Ansehen)", 
										  "Effect.Fade('bar_guests'); " + 
										  "Effect.toggle('online_bar_guests');"  if count_online_guests().to_i > 0 %>
				</td>
			</tr>
			
			<tr id="bar_guests" style="display:none;">
				<td class="full-column" colspan="2">
					<ul class="portrait-list">
			
						<% for guest in @bar.bar_guests do %>
						<li class="item" style="width: 50px; height: 63px;">
							<%= link_to_profile guest.user.id, 'small' %>
						</li>
						<% end %>
						
					</ul>
				</td>
			</tr>
			
			<tr id="online_bar_guests" style="display:none;">
				<td class="full-column" colspan="2">
					<ul class="portrait-list">
			
						<% for guest in guests_online() do %>
						<li class="item" style="width: 50px; height: 63px;">
							<%= link_to_profile guest.id, 'small' %>
						</li>
						<% end %>
						
					</ul>
				</td>
			</tr>
			
			<tr>
				<td class="left-column">Mitarbeiter</td>
				<td class="right-column">
					<%= h(@bar.bar_coworkers_count) %>
					<%= link_to_function "(Ansehen)", 
										  "Effect.toggle('bar_coworkers');" if @bar.bar_coworkers_count.to_i > 0 %>
				</td>
			</tr>
			
			<tr id="bar_coworkers" style="display:none;">
				<td class="full-column" colspan="2">
					<ul class="portrait-list">
			
						<% for coworker in @bar.bar_coworkers do %>
						<li class="item" style="width: 50px; height: 63px;">
							<%= link_to_profile coworker.user.id, 'small' %>
						</li>
						<% end %>
						
					</ul>
				</td>
			</tr>
			
			<tr>
				<td class="left-column">Besitzer</td>
				<td class="right-column"><%= h(@bar.bar_owners_count) %></td>
			</tr>
			
			<tr>
				<td class="left-column">Events</td>
				<td class="right-column">
					<%= h(@bar.events_count) %>
					<a href="#events" title="Alle Events ansehen">
						(Ansehen)
					</a>
				</td>
			</tr>
			
		</table>
		
		<h4>Wer geht heute hin?</h4>
		<% if @todays_visitors.blank?%>
		<p class="noentry">
			Heute geht leider noch niemand hin...
		</p>
		<% else %>
		<ul class="portrait-list">
			
			<% for visitor in @todays_visitors do %>
			<li class="item" style="width: 50px; height: 63px;">
				<%= link_to_profile visitor.user.id, 'small' %>
			</li>
			<% end %>
			
		</ul>
		<% end %>
		
		<a name="feed"></a>
		<h4 style="clear:left;">Neuigkeiten</h4>
		
		<%= render :partial => "feed",
				   :locals  => {:feed => @feed} %>
		
		<a name="events"></a>
		<h4 style="clear:left;">Events</h4>
		
		<% if @bar.events.blank? %>
			<p class="noentry">
				Leider sind nich keine Events zu dieser Bar eingetragen...
			</p>
		<% else %>
			<ul class="event-list">
				<%= render :partial		=> "layouts/events_list",
						   :collection  => @bar.events %>
			</ul>
		<% end %>
		
	</div>
</div>